﻿using System;
using System.Collections.Generic;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine(GetTime(Convert.ToDateTime("2021-03-10 10:42")));



            var b = Get2();
            var a = Get();
            var list = new List<string>();
            int j = 0;

            for (int i = 0; i < b.Count; i++)
            {
                for (var f =0;  f < 3; f++)
                {
                    list.Add(a[j].ToString());
                    j++;
                    if (j > a.Count-1)
                    {
                        j = 0;
                    }
                }
                list.Add(b[i].ToString());
            }
            foreach (var item in list)
            {
               // Console.WriteLine(item);
            }


            Console.WriteLine("Hello World!");
            Console.ReadLine();
        }
        static List<int> Get()
        {
            var list = new List<int>();
            for (int i = 0; i < 7; i++)
            {
                list.Add(i);
            }
            return list;
        }



        // <summary>
        /// 获取时间差
        /// </summary>
        /// <param name="getTime">数据库时间</param>
        /// <returns>时间差</returns>
        static string GetTime(DateTime getTime)
        {
            var time1 = Convert.ToDateTime(getTime.ToString("yyyy-MM-dd HH:mm:ss"));
            var time = DateTime.Now - time1;

            if (time.TotalHours > 24)
            {
                return getTime.ToString("yyyy-MM-dd");
                // return Math.Floor(time.TotalDays) + "天前";
            }
            if (time.TotalHours > 1)
            {
                return Math.Floor(time.TotalHours) + "小时前";
            }
            if (time.TotalMinutes > 1)
            {
                return Math.Floor(time.TotalMinutes) + "分钟前";
            }
            if (time.TotalSeconds < 1)
            {
                return getTime.ToString("yyyy-MM-dd");
            }

            return Math.Floor(time.TotalSeconds) + "秒前";
        }


        static List<string> Get2()
        {
            var list = new List<string>();
            for (int i = 0; i < 10; i++)
            {
                list.Add("b"+i);
            }
            return list;
        }

    }


    



}
